package com.zengqingfa.examples.mybatisplus.rest;

import com.zengqingfa.examples.mybatisplus.entity.User;
import com.zengqingfa.examples.mybatisplus.response.Result;
import com.zengqingfa.examples.mybatisplus.strategy.ProcessStrategyContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * @fileName: ProcessController
 * @author: zengqf3
 * @date: 2021-4-8 17:47
 * @description:
 */
@RestController
@RequestMapping("/process")
public class ProcessController {

    @Autowired
    ProcessStrategyContext processStrategyContext;

    @GetMapping("/getStrategy")
    public Result selectById(@RequestParam("processId") Long processId) {
        String process = processStrategyContext.process(processId);
        return Result.success(process);
    }
}
